package sostats.core.query;

import java.util.Arrays;

public class DataCell {
	private int value;
	private Object[] categories;
	public DataCell(int dimension){
		categories = new Object[dimension];
	}
	public DataCell(Object value, Object... categories){
		setValue(value);
		this.categories = Arrays.copyOf(categories, categories.length);
	}
	public void setValue(Object value){
		this.value = Integer.valueOf(value.toString());
	}
	public void setCategory(int index, Object categoryValue){
		categories[index]=categoryValue;
	}
	public int dimension(){
		return categories.length;
	}
	public int getValue(){
		return value;
	}
	public Object[] getCategories(){
		return Arrays.copyOf(categories, categories.length);
	}
	public Object getCategory(int dimensionIndex) {
		return categories[dimensionIndex];
	}
	@Override
	public DataCell clone(){
		return new DataCell(value,categories);
	}
}
